﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Common.BaseModel;

namespace ExpenseSystem.Common
{
    public class MyEqualityComparer<T> : IEqualityComparer<T> where T : SuperModel, new()
    {
        public bool Equals(T x, T y)
        {
            return x.AutoId.Equals(y.AutoId);
        }

        public int GetHashCode(T obj)
        {
            return (typeof(T).GetHashCode().ToString() + obj.AutoId.ToString()).GetHashCode();
        }
    }
}
